﻿@{
    ViewBag.Title = "信息编辑";
}

@section HeadPlugin{



}
<!-- BEGIN EDITOR FORM-->
<div class="col-md-12">
    <!-- 一列规范 一般在Row下面-->
    <div class="table-toolbar">
        <div class="btn-group">
            <button id="sample_editable_1_new" class="btn green">
                Add New <i class="fa fa-plus"></i>
            </button>
        </div>

    </div>

    

    <!-- 富文本编辑： http://ueditor.baidu.com/ -->
    <!--style给定宽度可以影响编辑器的最终宽度-->
    <script id="editor" type="text/plain" style="width:100%;height:500px;">
    </script>
    <div id="eucontext"></div>
</div>
<!-- END EDITOR FORM-->
@section FootPlugin{
    <script type="text/javascript">
        window.UEDITOR_IMG_UPURL = "@Url.Action("EditorImgUp", "Handle")";
        //图片上传地址
        window.UEDITOR_IMG_MANAGERURL = "@Url.Action("EditorImgMangaer", "Handle")";
        //图片管理地址
        window.UEDITOR_IMG_PATH = "/";
        //图片访问路径（修正路径）
    </script>
    <script type="text/javascript" src="~/Content/Plugin/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="~/Content/Plugin/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Content/Plugin/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript">
        //实例化编辑器
        var ue = UE.getEditor('editor');
        $(function () {
            $("#sample_editable_1_new").click(function () {
                if (ue.hasContents()) { //此处以非空为例
                    //ue.sync(); //同步内容

                    $.ajax({ url: "@Url.Action("EditorSubmit", "Handle")", type: "POST", data:{ 'content':encodeURIComponent(ue.getContent())} }).done();
                }
            });

        });
    </script>
}
